package cn.itsource.basic.controller;

import cn.itsource.basic.base.service.ILoginService;
import cn.itsource.basic.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private ILoginService loginService;

    @PostMapping("/account")
    public AjaxResult accountLogin(@RequestBody Map<String,Object> map) throws Exception {
        return loginService.accountLogin(map);
    }

    @PostMapping("/wechat")
    public AjaxResult wechatLogin(@RequestBody Map<String,String> map) throws Exception {
        return loginService.wechatLogin(map);
    }

    @PostMapping("/binder")
    public AjaxResult binder(@RequestBody Map<String,String> map) throws Exception {
        return loginService.binder(map);
    }
}
